/*
 * @Author: 灰灰
 * @Date: 2021-12-26 17:31:10
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-01-10 17:00:08
 */
const Mock = require('mockjs')

const data = Mock.mock({
  'items|30': [{
    id: '@id',
    title: '@sentence(10, 20)',
    'status|1': ['published', 'draft', 'deleted'],
    author: 'name',
    display_time: '@datetime',
    pageviews: '@integer(300, 5000)'
  }]
})

const menuList = [{
  id: 0,
  path: '/dashboard',
  permName: '首页',
  permCode: 'Dashboard',
  permType: 'menu',
  icon: 'dashboard',
  pid: null,
}, {
  id: 1,
  path: '/example',
  permName: '案例',
  permCode: 'Example',
  permType: 'menu',
  icon: 'el-icon-s-help',
  pid: null,
}, {
  id: 1223,
  path: '/example/eg',
  permName: '例子',
  permCode: 'eg',
  permType: 'menu',
  icon: 'table',
  pid: 1,
}, {
  id: 1223,
  path: '/example/page',
  permName: '分页例子',
  permCode: 'page',
  permType: 'menu',
  icon: 'table',
  pid: 1,
}, {
  id: 1223,
  path: '/example/page2',
  permName: '分页例子2',
  permCode: 'page2',
  permType: 'menu',
  icon: 'table',
  pid: 1,
}, {
  id: 1224,
  path: '/example/echart',
  permName: 'Echarts',
  permCode: 'echart',
  permType: 'menu',
  icon: 'table',
  pid: 1,
}, {
  id: 101,
  path: '/example/table',
  permName: '表格',
  permCode: 'Table',
  permType: 'menu',
  icon: 'table',
  pid: 1,
}, {
  id: 102,
  path: '/example/tree',
  permName: '树形表格',
  permCode: 'Tree',
  permType: 'menu',
  icon: 'tree',
  pid: 1,
}, {
  id: 2,
  path: '/form',
  permName: '表单父级',
  permCode: 'FormParent',
  permType: 'menu',
  icon: 'form',
  pid: null,
}, {
  id: 201,
  path: '/form/index',
  permName: '表单',
  permCode: 'Form',
  permType: 'menu',
  icon: 'form',
  pid: 2
}];

const permCodes = [{
  id: 10001,
  path: '',
  permName: '表单-创建按钮',
  permCode: 'FormCreated',
  permType: 'feature',
  icon: '',
  pid: 2
}]

module.exports = [{
  url: '/vue-admin-template/menu/list',
  type: 'get',
  response: config => {
    return {
      code: 20000,
      data: menuList
    }
  }
}, {
  url: '/vue-admin-template/perm/list',
  type: 'get',
  response: config => {
    return {
      code: 20000,
      data: permCodes
    }
  }
}]